package math.geom2d;

import math.geomUtils.CurveType;

/**
 * @author Saga
 *
 */
public class EllipticalArc2d extends TrimmedCurve2d {

    public EllipticalArc2d(final Ellipse2d _ellipse, final double _firstParam,
            final double _lastParam) {
        super(_ellipse, _firstParam, _lastParam);
    }

    @Override
    public CurveType getCurveType() {
        return CurveType.ELLIPTICAL_ARC;
    }

    @Override
    public final void reverse() {
        this.baseCurve.reverse();
        final double period = this.getPeriod();
        this.firstParam = period - this.lastParam;
        this.lastParam = period - this.firstParam;
    }

    @Override
    public final Curve2d reversed() {
        final double period = this.getPeriod();
        return new EllipticalArc2d((Ellipse2d) this.baseCurve, period - this.lastParam,
                period - this.firstParam);
    }
}
